﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 统一结果返回
    /// </summary> 
    /// <remarks>
    /// 统一结果返回 构造函数
    /// <para>默认成功2000 无提示信息</para>
    /// </remarks>
    /// <param name="data">数据</param>
    /// <param name="codeEnum">业务状态码 默认成功2000</param>
    /// <param name="msg"></param>
    public class ResResult(
        dynamic data, ResultEnum code = ResultEnum.Suceess, string msg = null!
        )
    {
        /// <summary>
        /// 业务状态码
        /// <para>和http响应码要区分开</para>
        /// </summary>
        public ResultEnum Code { set; get; } = code;
        /// <summary>
        /// 提示信息
        /// </summary>
        public string? Msg { set; get; } = msg;

        /// <summary>
        /// 数据
        /// </summary>
        public dynamic Data { set; get; } = data;

       
    }
}
